package PolymorphismBlogDemo;

public class Animal {
    public void eat(){
        System.out.println("吃东西");
    };
}
class Wolf extends Animal {
    @Override
    public void eat() {
        System.out.println("吃肉");
    }
}
class Sheep extends Animal {
    public void eat() {
        System.out.println("吃草");
    }
}
class Run {
    public static void main(String[] args) {
        Wolf wolf = new Wolf();
        Sheep sheep = new Sheep();
        wolf.eat();
        sheep.eat();
    }
}
